package com.tj.collection.db.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.tj.collection.db.dao.AiOverdueOutboundDao;
import com.tj.collection.db.entity.AiOverdueOutboundEntity;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: cashmama
 * @Date: 2020/11/5-10:30
 * @Description: TODO
 * @Slogan: To be or not to be
 **/
@Component
public class AiOverdueOutboundDaoImpl extends AbstractBaseMapper<AiOverdueOutboundEntity> implements AiOverdueOutboundDao {
    @Override
    public List<AiOverdueOutboundEntity> getOverdueOutboundByDays(int minDays, int maxDays, String merChantCode,int dayNum) {
        Map<String, Object> map = new HashMap<>();
        map.put("minDays", minDays);
        map.put("maxDays", maxDays);
        map.put("merChantCode", merChantCode);
        map.put("dayNum", dayNum);
        return this.getSqlSession().selectList(this.getStatement("getOverdueOutboundByDays"), map);
    }

    @Override
    public void updateAiOverdueStatus(String mobile, Integer status) {
        Map<String, Object> param = new HashMap<String, Object>() {{
            put("mobile", mobile);
            put("status", status);
        }};
        this.getSqlSession().update(this.getStatement("updateAiOverdueStatus"), param);
    }
}
